package office.dao.hr;

import platform.common.dao.impl.BaseDomainProviderImpl;

public class RecruitPlanDP extends BaseDomainProviderImpl{

	public String getFindAll(){
		return "select new office.action.hr.wrapper.RecruitPlanWrapper" +
				"(a.id,a.planName,a.pipeline,a.budgetFee,a.startDate,a.endDate,a.recruitPopulation," +
				"a.recruitMemo,a.recruitRemark,a.checkUser,a.state,b.cname,a.userId) from "+
				this.getDomainClassName()+" a,User b where a.userId = b.id";
	}
//	String id,String planName,String pipeline,double budgetFee,
//	String startDate,String endDate,int recruitPopulation,String recruitMemo,
//	String recruitRemark,String checkUser,String state,String checkUserName,String userId
	public String getFindUserId(){
		return "select new office.action.hr.wrapper.RecruitPlanWrapper" +
				"(a.id,a.planName,a.pipeline,a.budgetFee,a.startDate,a.endDate,a.recruitPopulation," +
				"a.recruitMemo,a.recruitRemark,a.checkUser,a.state,b.cname,a.userId,a.checkRole) from "+
				this.getDomainClassName()+" a,User b where a.userId = b.id " +
				"and (a.userId=:userId or checkRole =:checkRole) and b.department.id in (:deptId) order by a.entryDate desc";
	}
	
//	
//	/**
//	 * 获取某用户提交的或需要自己审批的贷款
//	 * @return
//	 */
//	public String getFindByUserIdCheckRole(){
//		return "select new office.action.finance.form.LoanForm(a.id,a.entryLoan," +
//				"a.remark,a.userId,a.entryRole,a.checkRole,a.entryDate," +
//				"a.state,b.name) from "+this.getDomainClassName()+" a,User b where " +
//				"(a.userId=:userId or checkRole =:checkRole) and a.userId = b.id  order by a.entryDate desc";
//	}
//	/**
//	 * 获取某用户提交的或需要自己审批的贷款(销售人员、区域经理、销售经理需要限制是和自己同一部门人提交审批的记录)
//	 * @return
//	 */
//	public String getFindByUserIdCheckRoleDept(){
//		return "select new office.action.finance.form.LoanForm(a.id,a.entryLoan," +
//				"a.remark,a.userId,a.entryRole,a.checkRole,a.entryDate," +
//				"a.state,b.name) from "+this.getDomainClassName()+" a,User b where " +
//				"(a.userId=:userId or checkRole =:checkRole) and a.userId = b.id  and b.department.id = :deptId order by a.entryDate desc";
//	}
}
